const express = require('express')
const path = require('path')
const app = express()
app.listen(3000, '0.0.0.0', () => console.log('http://localhost:3000'))
app.engine('html', require('express-art-template'))
app.set('views', path.resolve('./views'))

let users = [
  { id: 1, name: '张三', age: 20 },
  { id: 2, name: '李四', age: 21 },
  { id: 3, name: '王五', age: 22 },
]


app.get('/', (req, res) => {
  res.render('02.html', {
    age: 11,
    users,
    titleObj: { title: '我是内容title' }
  })
})